package com.cntcdt.api.db.dao;

import java.util.List;

import com.cntcdt.api.db.dao.base.AddLineHistoryDaoBase;
import com.cntcdt.api.db.model.AddLineHistoryModel;

/**
 * 这是add_line_history的Dao实现类
 */
public class AddLineHistoryDao extends AddLineHistoryDaoBase   {
    /**
     * AddLineHistoryDao对象
     */
    private static AddLineHistoryDao instance = new AddLineHistoryDao();

    /**
     * 默认构造方法
     */
    private AddLineHistoryDao() {
    }

    /**
     * 获得对象实例
     */
    public static AddLineHistoryDao getInstance() { 
         return instance;
    } 

    /**
     * 按主键查询model
     * @param id id
     * @return model
     */
    public List<AddLineHistoryModel> findByTerminal(String terminal,int sortTime) {
    	sortTime = sortTime*20;
        String sql = "SELECT * FROM " + TABLE + " WHERE terminal = ? order by addTime desc limit ?,20";
       Object[] paramObjs = {terminal,sortTime};
       List<AddLineHistoryModel > modelList = this.queryModelList(sql, paramObjs);
       return modelList;
   }
}
